package com.credithc.signature.core.configure.datasource;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @desc: 数据源配置<br />
 * @author: Jingbo Hu<br/>
 * @time：2020年01⽉14⽇<br/>
 * @version：v1.0.0<br>
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring.dynamic.datasource")
public class DataSourceConfig {

    private Master master = new Master();
    private Slave slave = new Slave();

    @Data
    public static class Master {
        String jdbcUrl;
        String username;
        String password;
        String driverClassName;
    }

    @Data
    public static class Slave {
        String jdbcUrl;
        String username;
        String password;
        String driverClassName;
    }
}
